    angular.module('CrudApp', []).
    config(['$routeProvider', function($routeProvider) {
    $routeProvider.
    when('/', {templateUrl: 'lists.html', controller: ListCtrl}).
    when('/add-user', {templateUrl: 'add-new.html', controller: AddCtrl}).
    otherwise({redirectTo: '/'});
    }]);
    function ListCtrl($scope, $http) {
		$http.get('index.php').success(function(data) {
		$scope.users = data;
		});
    }
    function AddCtrl($scope, $http, $location) {
		$scope.master = {};
		$scope.activePath = null;
		$scope.add_new = function(user, AddNewForm) {
		console.log(user);
		$http.post('api/add_user', user).success(function(){
		$scope.reset();
		$scope.activePath = $location.path('/');
		});
		$scope.reset = function() {
		$scope.user = angular.copy($scope.master);
		};
		$scope.reset();
		};
    }